#include <iostream>
#include <vector>
#include <string>

using namespace std;

// int compareReversion(int )

int compareVersion(string version1, string version2) {
    version1.push_back('.'); version2.push_back('.');
    int pre1 = 0, point1 = version1.find('.'), pre2 = 0, point2 = version2.find('.');
    while(point1 != version1.npos || point2 != version2.npos){
        int l = point1 != version1.npos ? stoi(version1.substr(pre1, point1-pre1)) : 0, r = point2 != version2.npos ? stoi(version2.substr(pre2, point2-pre2)) : 0;
        if(l > r){
            return 1;
        }else if(l < r){
            return -1;
        }
        pre1 = point1 != -1 ? (point1 + 1) : pre1, point1 = version1.find('.', pre1), pre2 = point2 != -1 ? (point2 + 1) : pre2, point2 = version2.find('.', pre2);
    }
    return 0;
}

int main(){
    string version1 = "1.00000.1", version2 = "001";
    cout << compareVersion(version1, version2) << endl;
    return 0;
}
